<?php /** @noinspection PhpComposerExtensionStubsInspection */
/**
 * Created by PhpStorm.
 * User: 35906
 * Date: 18.10.23
 * Time: 23:18
 */
$word = '   打死李二牛  ';
$res = preg_match('/^\s*(@?李)?二牛|(@?李)?二牛\s*$/',$word);
$word1 = preg_replace('/@李二牛/','',$word);
$word2 = preg_replace('/(你)+(?:李)?二牛|(?:李)?二牛(你)+/','\1\2',$word1);
$word3 = preg_replace('/(\s|^)(李)?二牛(\s|$)/','',$word2);
$word4 = preg_replace('/(李)?二牛/','你',$word3);

var_dump($word,$res,$word1,$word2,$word3,$word4);
